package com.bob.usercenter.mapper;

import com.bob.usercenter.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bob.usercenter.entity.page.PageVO;
import com.bob.usercenter.entity.request.QueryPage;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
* @author 12948
* @description 针对表【user】的数据库操作Mapper
* @createDate 2024-01-19 10:08:40
* @Entity com.bob.usercenter.entity.User
*/
public interface UserMapper extends BaseMapper<User> {

    @Select("select * from yupi.user where userAccount = #{userAccount}")
    User selectUser(@Param("userAccount") String userAccount);

    @Select("SELECT id, " +
            "username, " +
            "userAccount, " +
            "avatarUrl, " +
            "gender, " +
            "phone, " +
            "email, " +
            "status, " +
            "createTime, " +
            "userRole " +
            "FROM yupi.user " +
            "WHERE username LIKE CONCAT('%', #{username}, '%')")
    List<PageVO> selectByPage(String username);

}




